﻿using System;
using System.Collections.Generic;
using System.Text;
using DC2010.Systems;
using DC2010.Objects;
using DC2010.Objects.Info;
using DC2010.Objects.Base;
using DC2010.Effects;

namespace DC2010
{
    public class Editor
    {
        private static Editor _i;
        private Editor()
        { 
        }

        public void Init()
        { }

        public static Editor I
        {
            get
            {
                if (_i == null)
                {
                    _i = new Editor();

                    _i.editorEffects = new List<EffectInfo>();
                    _i.editorCreatures = new List<CreatureInfo>();
                    _i.editorDoors = new List<DoorInfo>();
                    _i.editorItems = new List<ItemInfo>();
                    _i.editorSpells = new List<SpellInfo>();
                }
                return _i;
            }
        }

        public List<EffectInfo> editorEffects { get; set; }
        public List<CreatureInfo> editorCreatures { get; set; }
        public List<DoorInfo> editorDoors { get; set; }
        public List<ItemInfo> editorItems { get; set; }
        public List<SpellInfo> editorSpells { get; set; }

        public List<Effect> editorEffectsSerialize { get; set; }
        public List<Creature> editorCreaturesSerialize { get; set; }
        public List<Door> editorDoorsSerialize { get; set; }
        public List<Item> editorItemsSerialize { get; set; }
        public List<Spell> editorSpellsSerialize { get; set; }

        public string CurrentMapId { get; set; }
        public string ActiveTileType { get; set; }
        public int EffectsCount
        {
            get
            {
                return Root.I.EffectSystem.List.Count + 1;
            }
        }

        public int EffectsInstanceCount
        {
            get
            {
                return Root.I.EffectSystem.ListInstance.Count + 1;
            }
        }

        public int PartyCount
        {
            get
            {
                return Root.I.PartySystem.List.Count + 1;
            }
        }

        public int PartyInstanceCount
        {
            get
            {
                return Root.I.PartySystem.ListInstance.Count + 1;
            }
        }

        public int ItemsCount
        {
            get
            {
                return Root.I.ItemSystem.List.Count + 1;
            }
        }

        public int ItemsInstanceCount
        {
            get
            {
                return Root.I.ItemSystem.ListInstance.Count + 1;
            }
        }

        public int CreaturesCount
        {
            get
            {
                return Root.I.CreatureSystem.List.Count + 1;
            }
        }

        public int CreaturesInstanceCount
        {
            get
            {
                return Root.I.CreatureSystem.ListInstance.Count + 1;
            }
        }

        public int DoorsCount
        {
            get
            {
                return Root.I.DoorSystem.List.Count + 1;
            }
        }

        public int DoorsInstanceCount 
        {
            get
            {
                return Root.I.DoorSystem.ListInstance.Count + 1;
            }
        }

        public int TilesCount
        {
            get
            {
                return Root.I.TileSystem.List.Count + 1;
            }
        }

        public int TilesInstanceCount
        {
            get
            {
                return Root.I.TileSystem.ListInstance.Count + 1;
            }
        }

        public Type SelectedTile { get; set; }
    }
}
